<template>
	<view>
		<view class="mui-content" id="recharge-view" style="padding-left:20px;margin-right: 20px;">
			<view class="mui-table" style="display: flex;">
				<view class="mui-table-cell mui-col-xs-4">
					<view style="font-size: 33rpx;"><span>{{ketixianMoney}}积分</span></view>
					<p>已收积分</p>
				</view>
				<view class="mui-table-cell mui-col-xs-4">
					<view style="font-size: 33rpx;"><span id="zong">{{(ketixianMoney*jiesuanbi).toFixed(1)}}</span>元</view>
					<p>可提现金额</p>
				</view>
				<view class="mui-table-cell mui-col-xs-4">
					<view style="font-size: 33rpx;"><span id="price">{{(tixianzhongMoney*jiesuanbi).toFixed(1)}}</span>元</view>
					<p>提现中金额</p>
				</view>
				<view class="mui-table-cell mui-col-xs-4">
					<view style="font-size: 33rpx;"><span id="yiyong" @click="tixianRecord()">{{(yitixianMoney*jiesuanbi).toFixed(1)}}</span>元</view>
					<p>已提现</p>
				</view>
			</view>
			<view class="input-number" style="margin-top: 20rpx;">
				<input type="number" class="myinput" @input="onInput" pattern="\d*" id="import" placeholder="请输入需要提现金额" value="">
				<!--<input type="text" class="myinput" id="zfb" placeholder="请输入支付宝账号" value="">-->
				<!--<input type="text" class="myinput" id="zfbName" placeholder="请输入您的真实姓名" value="">-->
				<view class="pay" @click="shenqingtixian()">申请提现</view>
			</view>
			<p class="price">提现手续费为3.5%</p>
			<!--<p id="records" style="text-align:right;color: #FF6600;margin-top: 10px;margin-right: 5%;">我的提现记录</p>-->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				ketixianMoney:0,	//可提现金额
				tixianzhongMoney:0, //提现中金额
				yitixianMoney:0,	//已提现金额
				jiesuanbi:0.8,		//结算比
				inputMoney:0,		//文本框输入金额
				zfb:"",				//用户支付宝账号
				zfbName:"",			//用户支付宝名称
			}
		},
		onLoad() {
			this.$http.get('/gzh/gzhxcx', {
				userid:uni.getStorageSync('usersId')
			}).then(res => {
				console.log(res.data.code);
				if(res.data.code==200){
					this.ketixianMoney=res.data.data.jifen;
					this.tixianzhongMoney=res.data.data.dongjieJifen;
					this.yitixianMoney=res.data.data.yitixian;
					this.jiesuanbi=res.data.data.jiesuanbi;
				}
			})
		},
		methods: {
			onInput(e){
				this.inputMoney=e.target.value;
			},
			//查看你提现记录
			tixianRecord(){
				this.$u.toast("点击查看提现记录")
				return;
			},
			shenqingtixian(){
				if(this.inputMoney < 1.3){
					this.$u.toast("提现金额必须大于1.3积分");
					return;
				}
				this.$http.get('/tixian/tixianxcx', {
					money:this.inputMoney ,
					zfb:this.zfb==undefined || this.zfb==null || this.zfb.trim()=="" ? "" : this.zfb ,
					zfbName:this.zfbName==undefined || this.zfbName==null || this.zfbName.trim()=="" ? "" : this.zfbName,
					tixianUser:uni.getStorageSync('usersId')
				}).then(res => {
					this.$u.toast(res.data.msg);
				})
			},
			is_null(str){
				return str == undefined || str == null || str.trim() == "" ;
			}
		}
	}
</script>

<style>
	#yiyong{
		padding: 2px 3px;
		background-color: red;
		color: white;
		border-radius: 4px;
	}
	.nav-header {
		background-color: #000000;
		color: white;
	}
	.nav-header h1 {
		text-align: left;
	}
	.nav-header a {
		color: white;
	}
	.reminder {
		text-align: center;
		line-height: 40px;
		border-bottom: 1px solid #dfd0d0;
	}
	.box-a-1 {
		width: 25%;
		height: 30px;
		float: left;
		margin-right: 2%;
		border-radius: 6px;
		text-align: center;
		line-height: 30px;
		font-size: 14px;
	}
	#other {
		width: 90%;
		border: 1px solid #FF6700;
		height: 30px;
		margin-left: 5%;
		border-radius: 6px;
		text-align: center;
		line-height: 30px;
		font-size: 14px;
	}
	.present {
		text-align: center;
		line-height: 40px;
		font-size: 12px;
	}
	#caution {
		line-height: 5px;
		color: #FF6700;
		display: none;
	}
	.myinput {
		text-align: center;
		/* background-color: #efeff4; */
		background-color: white;
		padding: 20rpx 0 20rpx 0;
	}
	.price {
		text-align: center;
		font-size: 14px;
		margin-top: 10px;
	}
	.tishi {
		margin: 0;
		line-height: 25px;
	}
	.mui-content{
		margin-top: 10px;
	}
	.mui-table-cell{
		width: 33.3%;
		height: 60px;
		text-align: center;
		/*border: 1px solid red;*/
		line-height: 30px;
	}
	/* .mui-table-cell span{
		margin-left: 32%;
	} */
	.mui-table-cell p{
		text-align: center;
	}
	.pay {
		width: 90%;
		height: 40px;
		background: #FF6700;
		border-radius: 6px;
		text-align: center;
		margin-left: 5%;
		line-height: 40px;
		margin-top: 40px;
		color: #FFFFFF;
	}
	p{
		color: #84878c;
	}
</style>